Defines a model of the target distribution(s).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | public | :: | data_noise | = | 1.0d0 |
A parameter representing the noise in the data. |
|
| integer(kind=int32), | public | :: | likelihood_parallel_threshold | = | 10000 |
Minimum observation count for a threaded likelihood reduction. Adjust for the workload; nested worker teams are not created. |
Adds a new model parameter.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(inout) | :: | this |
The mcmc_target object. |
||
| class(distribution), | intent(in) | :: | x |
The parameter to add. |
Prior density in log-variance coordinates, including the Jacobian.
Log density of log variance, including the variance-transform Jacobian. The default variance-space prior is log-normal, so its transformed density is normal with mean zero and standard deviation data_noise. Override this binding when changing the variance prior used by the sampler.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(in) | :: | this |
Target with finite, positive data_noise. |
||
| real(kind=real64), | intent(in) | :: | log_variance |
Natural logarithm of the variance. |
Log transformed prior; invalid prior parameters or NaN input give NaN.
Evaluates the PDF's for each parameter and computes a probability.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(in) | :: | this |
The mcmc_target object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
An N-element array containing the values at which to evaluate each of the N parameter PDF's. |
The resulting probability.
Computes the log prior density with respect to variance, without its log-coordinate Jacobian. Sampling uses evaluate_log_variance_prior instead.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(in) | :: | this |
The mcmc_target object. |
||
| real(kind=real64), | intent(in) | :: | x |
The value at which to evaluate the variance prior distribution PDF. |
Log prior density; outside support gives -infinity, invalid inputs NaN.
Gets a pointer to the stored parameter.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(in) | :: | this |
The mcmc_target object. |
||
| integer(kind=int32), | intent(in) | :: | i |
The index of the parameter to retrieve. If outside the bounds of the collection of parameters a null pointer is returned. |
A pointer to the requested parameter distribution.
Gets the number of model parameters.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(in) | :: | this |
The mcmc_target object. |
The parameter count.
Computes the Gaussian log likelihood. Invalid variance gives NaN.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(inout) | :: | this |
The mcmc_target object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | xdata |
An M-element array containing the independent data points. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | ydata |
An M-element array containing the dependent data points. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | xc |
An N-element array containing the model parameters. |
|
| real(kind=real64), | intent(in) | :: | var |
Finite, strictly positive model variance; it is not silently clamped. |
Log likelihood, or NaN for invalid/nonfinite inputs.
Gaussian log likelihood accepting log variance directly.
Computes the Gaussian log likelihood without exponentiating the variance. Residual magnitudes are scaled in log space before their squared reduction. Override this binding for custom likelihoods used by the sampler; overriding only likelihood changes calls to that variance-space entry point, not sampling.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(inout) | :: | this |
Target; its model workspace is resized as necessary. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | xdata |
M finite independent observations. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | ydata |
M finite dependent observations. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | xc |
Finite parameters, one per registered parameter distribution. |
|
| real(kind=real64), | intent(in) | :: | log_variance |
Finite natural logarithm of the model variance. |
Log likelihood; empty data give zero, invalid inputs/models give NaN, and an unrepresentably large residual penalty gives negative infinity.
Posterior density in parameter/log-variance coordinates.
Evaluates the posterior density with respect to parameters and log variance. Includes the variance-transform Jacobian through evaluate_log_variance_prior. Impossible parameter states are rejected before model evaluation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(inout) | :: | this |
Target whose prior and log-likelihood bindings are evaluated. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | xdata |
Independent observations. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | ydata |
Dependent observations, the same size as xdata. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | xc |
Model parameters, one per registered distribution. |
|
| real(kind=real64), | intent(in) | :: | log_variance |
Natural logarithm of the model variance. |
Log posterior; impossible states give -infinity, invalid inputs give NaN.
Evaluates the model at the supplied values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(in) | :: | this |
The mcmc_target object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | xdata |
An M-element array containing the values at which to evaluate the model. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | xc |
An N-element array containing the model parameters. |
|
| real(kind=real64), | intent(out), | dimension(:) | :: | y |
An M-element array where the resulting model values wil be written. |
Samples the variance prior distribution for the requested number of samples.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mcmc_target), | intent(inout) | :: | this |
The mcmc_target object. |
||
| real(kind=real64), | intent(in) | :: | vc |
The prior variance term. |
||
| integer(kind=int32), | intent(in) | :: | n |
The number of samples. |
The requested samples.